$(function() {
  var search = getSearch().productId
  var brandName = getSearch().brandName
  $.ajax({
    url: 'http://127.0.0.1:9090/api/getproduct',
    dataType : 'json',
    data : {
      productid : search
    },
    success: function(info) {
      console.log(info)
      $('.mmb_secondNav .content').html(template('tmp2',info))

      $.ajax({
        url: 'http://127.0.0.1:9090/api/getcategorybyid',
        data: {
          categoryid : info.result[0].categoryId
        },
        success:function(info) {
          console.log(info)
          info.search = search
          $('.mmb_secondNav .title').html(template('tmp',info))
          $('.brandName').html(brandName)
        }
      })


    }
  })

  $.ajax({
    url:'http://127.0.0.1:9090/api/getproductcom',
    dataType:'json',
    data: {
      productid : search
    },
    success: function(info) {
      console.log(info)
      $('.mmb_comment .comment').html(template('tmp3',info))
    }
  })
})